package com.tiejun.ge.mvc.service.impl;

import cn.hutool.core.lang.UUID;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.tiejun.ge.mvc.entity.bo.UserBO;
import com.tiejun.ge.mvc.repository.UserRepository;
import com.tiejun.ge.mvc.service.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @program: springboot
 * @description: userService实现类
 * @author: getiejun
 * @create: 2025-07-31 00:05
 **/
@Service
public class UserServiceImpl implements UserService {
    
    @Resource
    private UserRepository userRepository;
    
    @Override
    public IPage<UserBO> page(int pageNum, int pageSize) {
        return userRepository.page(pageNum, pageSize);
    }

    @Override
    public void add(UserBO userBO) {
        userBO.setId(UUID.fastUUID().getMostSignificantBits());
        userRepository.insert(userBO);
    }

    @Override
    public UserBO detail(Long id) {
        return userRepository.detail(id);
    }
}
